{% extends "base.html" %}

{% block content %}

<script language="javascript" src="/static/js/jquery-1.2.1.pack.js" type="text/javascript"></script>
<script type="text/javascript" src="/static/js/jquery-calendar-pack.js" ></script>
<style type="text/css">@import url(/static/css/jquery-calendar.css);</style>
<script language="javascript" type="text/javascript">
$(document).ready
(
function()
{
    	popUpCal.regional['zh-cn'] = {
		dateFormat: 'YMD-'};
	popUpCal.setDefaults(popUpCal.regional['zh-cn']);
   $('#start_date').calendar({autoPopUp: 'focus',yearRange: '-10:+0'});
	$('#end_date').calendar({autoPopUp: 'focus',yearRange: '-10:+0'});

   });
 </script>

<div class="form-div">
  <form action="/statistics/agent/" name="searchForm" method='post'>
    <img src="/static/images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
	Program:<select name="p_id" id="p_id">
	<option value="0" {% ifequal p_id '0' %} selected="selected" {% endifequal %}>All</option>
{% for p in project_list %}
<option value="{{p.id}}" {% ifequal p.id p_id %} selected="selected" {% endifequal %}>{{p.name}}</option>
{% endfor %}
</select> From:<input type="text" id="start_date" name="start_date" value="{% if start_date %}{{start_date}}{% else %}begin{% endif %}" size="20" readonly="true"/>   To:<input type="text" id="end_date" name="end_date" value="{% if end_date %}{{end_date}}{% else %}now{% endif %}" size="20" readonly="true"/> 
<input type="submit" value="Search" class="button" />
  </form>
</div>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<table width='98%'  cellspacing='1' align='center' class='grid'><tr><td colspan='18' class='title' align="center">Statistics by agent</td></tr>
<tr valign='middle' align='left'></tr>
  <tr valign='middle' align='center'>
  <td class='odd' >agent</td>
  <td class='even' >members</td>
  <td class='odd' >email</td>
  <td class='even' >hc</td>  
<td class='odd' >i0</td> 
<td class='even' >i1</td>
<td class='odd' >i2</td> 
<td class='even' >i3</td>
<td class='odd' >i4</td> 
<td class='even' >s0</td>
<td class='odd' >s1</td> 
<td class='even' >s2</td>
<td class='odd' >s3</td> 
<td class='even' >s4</td>
<td class='odd' >s5</td> 
<td class='even' >s6</td>
<td class='odd' >s7</td> 
<td class='even' >cost</td>
  </tr>
  {% for a in agent %}
  <tr align='center'>
  <td class='odd' >{{a.name}}</td>
  <td class='even' >{{a.member}}({{a.pmembers}})</td>
  <td class='odd' >{{a.pemail}}</td>
  <td class='even' >{{a.phardcopy}}</td>  
<td class='odd' >{{a.pi_0}}</td> 
<td class='even' >{{a.pi_1}}</td>
<td class='odd' >{{a.pi_2}}</td> 
<td class='even' >{{a.pi_3}}</td>
<td class='odd' >{{a.pi_4}}</td> 
<td class='even' >{{a.ps_0}}</td>
<td class='odd' >{{a.ps_1}}</td> 
<td class='even' >{{a.ps_2}}</td>
<td class='odd' >{{a.ps_3}}</td> 
<td class='even' >{{a.ps_4}}</td>
<td class='odd' >{{a.ps_5}}</td> 
<td class='even' >{{a.ps_6}}</td>
<td class='odd' >{{a.ps_7}}</td> 
<td class='even' >{{a.pcost}}/{{a.pbudget}}</td> 
  </tr>

  {% endfor %}


</table>

</td></tr></table>

{% endblock %}